package com.zsh.handler;

import java.lang.ref.WeakReference;

import com.zsh.activities.SplashActivity;
import com.zsh.constant.Constant;

import android.os.Handler;
import android.os.Message;

public class SplashHandler extends Handler {
	private final WeakReference<SplashActivity> mActivity;

	public SplashHandler(SplashActivity activity) {
		mActivity = new WeakReference<SplashActivity>(activity);
	}

	@Override
	public void handleMessage(Message msg) {
		SplashActivity activity = mActivity.get();
		if (activity != null) {
			switch (msg.what) {
			case Constant.GO_MAIN:
				activity.goMain();
				break;
			case Constant.GO_FEATURES:
				activity.goFeatures();
				break;
			}
			super.handleMessage(msg);
		}
	}
}
